﻿/// <reference path="../JScript/jquery-1.6.min.js" />
/// <reference path="../JScript/jquery.easyui.min.js" />
/// <reference path="../JScript/easyui-lang-zh_CN.js" />
/// <reference path="../JScript/AutoResize.js" />

$(document).ready(function() {
    $('#SalaryWin').window({
        closed: true,
        modal: true,
        minimizable: false,
        maximizable: false,
        collapsible: false
    });
    $('#btnSubmit,#btnCancel').linkbutton();
    autoResize({ dataGrid: '#SalaryGrid', callback: InitSalarylist });
});
function InitSalarylist(size) {
    $('#SalaryGrid').datagrid({
        iconCls: 'icon-save',
        width: size.width,
        height: size.height,
        pageSize: Math.round(size.height / 25),
        pageList: [Math.round(size.height / 25)],
        nowrap: true,
        striped: true,
        fitColumns: true,
        //        url: '../Project/Handler/ProjectInfo.ashx',
        sortName: 'ID',
        sortOrder: 'desc',
        idField: 'Id',
        frozenColumns: [[{ title: '编号', field: 'Id', width: 80, sortable: true}]],
        columns: [[
              { field: 'Name', title: '员工姓名', width: 120 },
            { field: 'BasicSalary', title: '基本工资', width: 120 },
            { field: 'PostSalary', title: '岗位工资', width: 80 },
            { field: 'YearSalary', title: '年功工资', width: 60 },
            { field: 'PerformanceBonus', title: '绩效奖金', width: 60 },
            { field: 'YearBonus', title: '年终奖金', width: 60 },
            { field: 'ProjectBonus', title: '项目奖金', width: 60 },
            { field: 'OtherSalary', title: '其他', width: 80 },
            { field: 'WageStandard', title: '福利工资标准', width: 80 },
            { field: 'DeductionSalary', title: '扣薪', width: 80 },
            { field: 'SalaryAdjustReason', title: '调薪原因', width: 80 }
        ]],
        pagination: true,
        rownumbers: true,
        singleSelect: true,
        toolbar: [
            {
                text: '添加',
                iconCls: 'icon-add',
                handler: function() {
                    $('#SalaryWin').show();
                    $('#SalaryWin').window("open");
                    $('#SalaryWin').form("clear");
                }
            },
            {
                text: '修改',
                iconCls: 'icon-edit',
                handler: function() {

                }
            },
            {
                text: '查询',
                iconCls: 'icon-search',
                handler: function() {
                    $.messager.alert('提示', '查询', 'error');
                }
            }
        ]
    });
}